home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MEDIA / Net.dxr / Internal_2_import ad code.ls < prev    next >
Encoding:
Text File  |  1998-03-03  |  1.7 KB  |  67 lines

  1. on getNetData
  2.   global myFile
  3.   if the machineType = 256 then
  4.     set i to the moviePath & "\ADS\net.dat"
  5.   else
  6.     set i to the moviePath & "ADS:net.dat"
  7.   end if
  8.   set DaPath to i
  9.   if objectp(myFile) then
  10.     set myFile to 0
  11.   end if
  12.   set myFile to new(xtra("fileio"))
  13.   openFile(myFile, DaPath, 1)
  14.   set Adinfo to readFile(myFile)
  15.   put Adinfo into field "netData"
  16.   closeFile(myFile)
  17.   set myFile to 0
  18. end
  19.  
  20. on countNetAds
  21.   global numBanners
  22.   set numBanners to the lineCount of member "netData"
  23.   put numBanners
  24. end
  25.  
  26. on importNetAds
  27.   global myFile, numBanners
  28.   if the machineType = 256 then
  29.     set i to the moviePath & "ADS\netList.dat"
  30.   else
  31.     set i to the moviePath & "ADS:netList.dat"
  32.   end if
  33.   set DaPath to i
  34.   if objectp(myFile) then
  35.     set myFile to 0
  36.   end if
  37.   set myFile to new(xtra("fileio"))
  38.   openFile(myFile, DaPath, 1)
  39.   set Adinfo to readFile(myFile)
  40.   put Adinfo into field "netList"
  41.   closeFile(myFile)
  42.   set myFile to 0
  43.   if the machineType = 256 then
  44.     set finalPath to the moviePath & "ADS\"
  45.   else
  46.     set finalPath to the moviePath & "ADS:"
  47.   end if
  48.   set the itemDelimiter to TAB
  49.   set flibbertyGibbet to the number of items in field "netList"
  50.   if numBanners = 3 then
  51.     repeat with x = 1 to 6
  52.       set canOfWhupAss to finalPath & item x of field "netList"
  53.       set the fileName of member (x + 10) of castLib "ad banners" to canOfWhupAss
  54.     end repeat
  55.   else
  56.     if numBanners = 4 then
  57.       repeat with x = 1 to 8
  58.         set canOfWhupAss to finalPath & item x of field "netList"
  59.         set the fileName of member x of castLib "ad banners" to canOfWhupAss
  60.       end repeat
  61.     else
  62.       alert("Import error.")
  63.     end if
  64.   end if
  65.   set the itemDelimiter to ","
  66. end
  67.